#include <string>
#include <iostream>
#include <sstream>

#include "baseEffect.h"
#include "playerEffect.h"
#include "basePlayer.h"
#include "baseCard.h"

using namespace std;

class baseEffect;

playerEffect::playerEffect(string aName, string aDescription, int aAddActions, int aAddTokens) : baseEffect(aName, aDescription), addActions(aAddActions), addTokens(aAddTokens) {}

string playerEffect::toString()
{
    stringstream out;

    out << baseEffect::toString() << endl;
    out << "applies on players" << endl;

    return out.str();
}

int playerEffect::getAddActions()
{
    return addActions;
}

int playerEffect::getAddTokens()
{
    return addTokens;
}

baseEffect::effectType playerEffect::getType()
{
    return type;
}

void playerEffect::doEffect(void* aPlayer)
{
    basePlayer* player = (basePlayer*)aPlayer;

    if(player)
    {
        player->addActions(getAddActions());
        player->addTokens(getAddTokens());

        getHostCard()->getOwner()->actionDone();
    }
}
